<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>后台管理</title>
		<link rel="stylesheet" type="text/css" href="../../backstagestatic/admin/layui/css/layui.css" />
		<link rel="stylesheet" type="text/css" href="../../backstagestatic/admin/css/admin.css" />
	</head>
	<body>
		<div class="wrap-container">
			<form class="layui-form" action="" style="width: 90%;padding-top: 20px;">

					<div class="layui-form-item">
						<label class="layui-form-label">书籍名称：</label>
						<div class="layui-input-block">
							<input type="text" name="name" required lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
						</div>

					</div>

					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">书籍图片 ：</label>
						<div class="layui-input-block">
							<input type="text" name="imgUrl" required lay-verify="required" placeholder="请输入图片url" autocomplete="off" class="layui-input">
						</div>
					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">书籍作者：</label>
						<div class="layui-input-block">
							<input type="text" name="author" required lay-verify="required" placeholder="请输入作者" autocomplete="off" class="layui-input">
						</div>

					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">出版社：</label>
						<div class="layui-input-block">
							<input type="text" name="press" required lay-verify="required" placeholder="请输入出版社" autocomplete="off" class="layui-input">
						</div>

					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">出版日期：</label>
						<div class="layui-input-block">
							<input type="text" name="publicationDate" required lay-verify="required" placeholder="出版日期（xxxx-xx-xx）" autocomplete="off" class="layui-input">
						</div>

					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">书籍价格：</label>
						<div class="layui-input-block">
							<input type="text" name="price" required lay-verify="required" placeholder="请输入价格" autocomplete="off" class="layui-input">
						</div>

					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">书籍分类 ：</label>
						<div class="layui-input-block">
							<input type="radio" name="type" value="0" title="人文" checked>
							<input type="radio" name="type" value="1" title="儿童">
							<input type="radio" name="type" value="2" title="教育">
							<input type="radio" name="type" value="3" title="文艺">
						</div>

					</div>

					<div class="layui-form-item">
						<label class="layui-form-label">书籍数量 ：</label>
						<div class="layui-input-block">
							<input type="text" name="inventory" required lay-verify="required" placeholder="请输入数量" autocomplete="off" class="layui-input">
						</div>

					</div>
					<div class="layui-form-item layui-form-text">
						<label class="layui-form-label">书籍信息 ：</label>
						<div class="layui-input-block">
							<textarea name="briefIntro" placeholder="请输入书籍详细信息" class="layui-textarea"></textarea>
						</div>
					</div>

					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn layui-btn-normal" type="submit"lay-submit lay-filter="formDemo">立即提交</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
		</div>
        <script src="../../js/jquery.min.js"></script>
		<script src="../../backstagestatic/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
        <script src="../../js/jquery.form.js"></script>
		<script>
            //Demo
            layui.use(['form'], function() {
                var form = layui.form();

                var options = {
                    url: '/bookAdd',
                    method: "post",
                    success: function() {
                        alert("提交成功");

                    }
                };
                $(".layui-form").eq(0).ajaxForm(options);

            });


		</script>
	</body>

</html>